package com.example.singleton;

/**
 * @Description 饿汉式
 * 是否 Lazy 初始化：否
 * 是否多线程安全：是
 * 实现难度：易
 * @Date 2021/10/21 20:32
 * @Author ZhangJi
 * @Version 1.0
 */
public class HungrySingleObject {

  private static final HungrySingleObject SINGLE = new HungrySingleObject();

  private HungrySingleObject(){}

  public static HungrySingleObject getSingle(){
    return SINGLE;
  }

  public void showMessage(){
    System.out.println("Hello World，HungrySingleObject!");
  }

}
